1. Field of the Invention
The present invention relates to instruction caching. More particularly, the present invention relates to caching an instruction loop executed by a microprocessor.
2. Description of the Related Art
Instruction cache is an essential component of a microprocessor. When a microprocessor needs to fetch an instruction, its processor core sends the fetch address of the instruction to the instruction cache. The fetch address corresponds to an instruction stream, which comprises one or more instructions. The instruction cache supplies the instruction directly from itself to the processor core when the instruction is already stored in the instruction cache. Otherwise, the instruction cache fetches the instruction from the memory where the instruction resides, stores the instruction, and supplies the instruction to the processor core. Since fetching an instruction from an external memory takes much more time and consumes much more power than fetching an instruction from the instruction cache, the instruction cache reduces power consumption and improves processing speed of the microprocessor.